from django.shortcuts import render
from django.views.decorators.http import require_http_methods

# Create your views here.
from django.http import HttpResponse
import hashlib, time


def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")

def md5_salt(txt):
    '''
    MD5 加密
    :return:
    '''
    nowTime = str(time.time())
    # token
    md5Txt = hashlib.md5(bytes(txt + 'wzy', encoding='UTF8'))
    md5Txt.update(bytes(nowTime, encoding='utf8'))
    return md5Txt.hexdigest()

if __name__ == '__main__':
    print(md5_salt("a2932623"))
    pass